/*
 * Created by SharpDevelop.
 * Author: Joey
 * Date: 25/09/2007
 * Time: 01:57
 * 
 * Source is copyright Joey Sabey 2007
 */

using System;
using System.Drawing;
using System.Windows.Forms;

namespace MonoTheism
{
	/// <summary>
	/// Description of FILE_Properties.
	/// </summary>
	public partial class FILE_Properties : Form
	{
		private bool bAcceptChanges = false;
		public bool AcceptChanges
		{
			get{return bAcceptChanges;}
		}
		public string Source
		{
			get{return this.txtSourceName.Text;}
		}
		public string EmbedName
		{
			get{return this.txtEmbedName.Text;}
		}
		
		public FILE_Properties()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
		}
		
		public FILE_Properties(string source, string embed)
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
			txtSourceName.Text = source;
			txtEmbedName.Text = embed;
		}
		
		void BtOkClick(object sender, EventArgs e)
		{
			bAcceptChanges = true;
			Close();
		}
		
		void BtCancelClick(object sender, EventArgs e)
		{
			Close();
		}
		
		void BtBrowseClick(object sender, EventArgs e)
		{
			OpenFileDialog ofdSelectFile = new OpenFileDialog();
			ofdSelectFile.Filter = "All Files|*.*|"
								 + "CAOS Files|*.cos|"
								 + "Sprite Files|*.s16|"
								 + "Compressed Sprite Files|*.c16|"
								 + "Sound Files|*.wav|"
								 + "Catalogue Files|*.catalogue";
			ofdSelectFile.ShowDialog();
			
			txtSourceName.Text = ofdSelectFile.FileName;
			
			if(txtEmbedName.Text.Length == 0)
			{
				txtEmbedName.Text = System.IO.Path.GetFileName(txtSourceName.Text);
			}
		}
	}
}
